Skip to content

Fix Styler.format() Excel example #49971

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 30, 2022
Merged

Fix Styler.format() Excel example #49971

merged 1 commit into from
Nov 30, 2022

Conversation

janosh
Copy link
Contributor

@janosh janosh commented Nov 30, 2022

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

@mroeschke mroeschke added Docs Styler conditional formatting using DataFrame.style labels Nov 30, 2022
@mroeschke mroeschke added this to the 2.0 milestone Nov 30, 2022
@mroeschke mroeschke merged commit 284758d into pandas-dev:main Nov 30, 2022
@mroeschke
Copy link
Member

Thanks @janosh

@attack68
Copy link
Contributor

attack68 commented Dec 1, 2022

That example didnt work.

TypeError: <lambda>() takes 0 positional arguments but 1 was given

Needs to be

df.style.applymap(lambda v: pseudo_css).to_excel("formatted_file.xlsx")

not

df.style.applymap(lambda: pseudo_css).to_excel("formatted_file.xlsx")

Can you re-submit.

@janosh
Copy link
Contributor Author

janosh commented Dec 1, 2022

@attack68 Sorry about that. Submitted a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Styler conditional formatting using DataFrame.style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants